package day8

import (
	"encoding/json"
	"fmt"
)

type Persion struct {
	Name string
	Age  int
}

func JsonU(str string) {
	var m Persion

	json.Unmarshal([]byte(str), &m)
	fmt.Println(m.Name, m.Age)
}

func ToJson() {
	p := Persion{
		"DD", 20,
	}

	str, _ := json.Marshal(p)

	fmt.Println(string(str))
}
